home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / T / Tools Plus 2.6 Evaluation.sit / Tools Plus 2.6 Evaluation Kit / Tools Plus 2.6 / User Manual / 05-Windows (2 of 3) < prev    next >
Encoding:
INI File  |  1994-09-17  |  29.9 KB  |  450 lines  |  [TEXT/ttxt]

  1. [Display using Monaco 9]
  2.  
  3.  
  4.  
  5. ToolBarOpen
  6. ```````````
  7. Open a tool bar and make it the “current” window.
  8.  
  9.    pascal void ToolBarOpen (short Window, short Height, short procID);
  10.  
  11.    procedure ToolBarOpen (Window, Height, procID: INTEGER);
  12.  
  13.   ToolBarOpen is used to open your application’s tool bar beneath the menu bar on your main monitor.  Your application can have only one tool bar.
  14.  
  15.   Window specifies the tool bar’s window number (just like an ordinary window).  Once the tool bar is opened, it is referenced by this window number.  If a window using the same window number is already open, it is closed, then a new tool bar is opened as specified by the parameters in the ToolBarOpen procedure, thereby re-using the window number.  The newly opened tool bar is always “active,” and it becomes “current” (action pertaining to graphics, text, buttons, scroll bars, etc. occurs in this window).  Tools Plus allows up to 50 windows to be open simultaneously, however, you may choose to reduce this limit when using InitToolsPlus to initialize Tools Plus.  If a tool bar is open and you try to open another toolbar using a different window number, ToolBarOpen does nothing.
  16.  
  17.   Height specifies the tool bar’s height.  A 1-pixel window frame is drawn just below the tool bar.  The tool bar’s height can be up to 70 pixels, but application’s typically have tool bars that seldom exceed 30 pixels.
  18.  
  19.   The tool bar’s procID influences the behavior of other windows in your application.  Two constants are available to assist in the implementation of a tool bar, either or both of which can be used to specify a tool bar procID.  If you decide not to use either of the available options, specify a procID of 0.
  20.  
  21.    tbShiftWindows      Shift all open windows downward by an amount that
  22.                        is equal to the menu bar’s height to prevent
  23.                        windows from being obscured by the tool bar.
  24.                        When the tool bar is closed, the windows are
  25.                        shifted up by the identical amount.
  26.  
  27.    tbOffsetNewWindows  If new windows are opened while the tool bar is
  28.                        open, offset their co-ordinates downward by an
  29.                        amount that is equal to the menu bar’s height to
  30.                        prevent windows from being obscured by the tool
  31.                        bar.  This option lets you use a standard set of
  32.                        window locations and have them automatically
  33.                        offset depending on whether the tool bar is open
  34.                        or not.
  35.  
  36.   Tool bars are typically colored a medium gray on color or gray-scale monitors, so you may want to declare a global variable of type RGBColor (appropriately named ToolBarGray) that has the red, green and blue components set to 52428.  When the tool bar is opened or whenever it is refreshed, you can paint its contents with the ToolBarGray if ScreenDepth is greater than or equals 4.
  37.  
  38.   CONST                     {Tool Bar options:                      }
  39.     tbShiftWindows    =$01; {Shift windows down when tool bar opens }
  40.     tbOffsetNewWindows=$02; {Offset future windows when they open   }
  41.  
  42. ------------------------------------------------------------------------
  43.  
  44. WindowClose
  45. ```````````
  46. Close an open window, tool bar or floating palette.
  47.  
  48.    pascal void WindowClose (short Window);
  49.  
  50.    procedure WindowClose(Window: INTEGER);
  51.  
  52.   The WindowClose procedure closes a window that was opened by WindowOpen, or a tool bar that was opened with ToolBarOpen.  If a standard window is being closed, the window immediately behind the newly closed window (if one exists) becomes active and current.
  53.  
  54.   Window specifies the window number that is closed.  If the specified window is not open, WindowClose does nothing.
  55.  
  56.   When a window is closed, it automatically releases the memory that was consumed by its associated buttons (including radio buttons and check boxes), picture buttons, pop-up menus, scroll bars, editing fields, list boxes, and custom controls.  If the affected window contains an active editing field, that field is automatically deactivated before the window is closed.  The impact to your application is that you must save the field’s edited text (with the SaveFieldString routine) before closing the window.  If you want to validate the field’s edited text before saving it, see the GetFieldString routine.
  57.  
  58.   When working with windows that are opened and closed frequently, you can take advantage of the WindowDisplay routine which hides and displays a window.  This is particularly useful when used on a tool bar or a floating palette because a hidden window remembers the settings of all the objects on the window (picture buttons, check boxes and radio buttons, editing fields, etc.) as well as the window’s location.  When the window is displayed again, it is identical in position and appearance as when it was hidden.
  59.  
  60. ------------------------------------------------------------------------
  61.  
  62. WindowSize
  63. ``````````
  64. Change a window’s size or a tool bar’s height.
  65.  
  66.    pascal void WindowSize (short Window, short Width, short Height,
  67.                  Boolean Update);
  68.  
  69.    procedure WindowSize (Window, Width, Height: INTEGER;
  70.                  Update: BOOLEAN);
  71.  
  72.   The WindowSize routine is used to change a window’s width and/or height without changing its position on the screen.  In most situations, windows that need resizing are best accommodated by the documentProc procID which provides a grow box in the bottom right corner of the window, and optionally a zoom box in the title bar.  Some applications, however, need a window that presents an “expanded” view.  An example of this the Macintosh’s Alarm Clock desk accessory which expands to let the user change the time, calendar and alarm timer.  Your application should change a window’s size only in response to some action taken by the user.
  73.  
  74.   Window specifies the window number that is resized.  If the specified window is not open or if it’s hidden, WindowSize does nothing.
  75.  
  76.   Width and Height specify the window’s new dimensions in pixels.  These dimensions relate to those specified by the WindowOpen routine, that is, they represent the content region or usable area of the window (the window’s frame, shadow, and title bar are all created outside of these co-ordinates).  The tool bar’s width cannot be changed, and its height cannot exceed 70 pixels.  All other windows’ new dimensions are automatically adjusted to keep them within the window’s size limits which are set with SetWindowSizeLimits.  If you specify zero (0) for either of these dimensions, it specifies that dimensions (height or width) should not be changed (i.e., WindowSize(1, 80, 0, true) changes window 1’s width to 80 pixels and leaves the height unchanged.
  77.  
  78.   Update specifies if the newly exposed area is added to the window’s update region (thereby producing a doRefresh event).  If you specify true, the newly exposed area is added to the window’s update region.  If you specify false, your application will handle the newly exposed area.
  79.  
  80. ------------------------------------------------------------------------
  81.  
  82. WindowMove
  83. ``````````
  84. Move a window to another location on the screen.
  85.  
  86.    pascal void WindowMove (short Window, short hGlobal, short vGlobal,
  87.                  short procID);
  88.  
  89.    procedure WindowMove (Window, hGlobal, vGlobal, procID: INTEGER);
  90.  
  91.   WindowMove repositions a window on the screen without changing its size.  Do not use WindowMove in place of having the user move a window to a new location by dragging the title bar.  Windows should only be moved in response to a user’s action, such as selecting an “Arrange Windows” menu item that arranges all open windows in a specified manner (grid or tile, for example).
  92.  
  93.   Window specifies the window number that is moved.  If the specified window is not open or if it’s hidden, WindowMove does nothing.
  94.  
  95.   HGlobal and vGlobal specify the window’s new location in global co-ordinates.  These dimensions relate to the top left corner specified by the WindowOpen routine, that is, they represent the top left corner of the content region or usable area of the window (the window’s frame, shadow, and title bar are all created outside of these co-ordinates).  The tool bar cannot be moved.
  96.  
  97.   ProcID specifies optional behavior that can take place while moving the window.  The value for this 2-byte integer can be specified by adding a set of constants to obtain the desired result.  The options are:
  98.  
  99.    wAnimateMove        Show “zoom lines” that move from the window’s
  100.                        original position to the window’s new position
  101.                        (see the ZoomLines routine for details).
  102.  
  103.    wOffsetForToolBar   Offset the specified vertical co-ordinate
  104.                        downward by the tool bar’s height (if a tool bar
  105.                        is open).
  106.  
  107.   CONST                       {Window moving options:              }
  108.     wAnimateMove      = $01;  {Animate with Zoom Lines             }
  109.     wOffsetForToolBar = $02;  {Offset co-ords by tool bar’s height }
  110.  
  111. ------------------------------------------------------------------------
  112.  
  113. WindowDisplay
  114. `````````````
  115. Hide or show a window, floating palette, or tool bar.
  116.  
  117.    pascal void WindowDisplay (short Window, Boolean Show);
  118.  
  119.    procedure WindowDisplay (Window: INTEGER; Show: BOOLEAN);
  120.  
  121.    From a user’s perspective, a window that is “hidden” by your application is actually being closed.  If a standard window is hidden, the standard window behind it is activated.  When a window is displayed (unhidden), it appears as though the window was opened, in that it appears at the front of its layer and becomes “active” and “current.”  Your application should hide and show windows in response to a user’s action, such as selecting a “Hide Tool Bar” menu item.  Tools Plus automatically hides the tool bar and all floating palettes when your application is suspended under MultiFinder or System 7, and displays them when your application is activated.
  122.  
  123.   Window specifies the window number that is hidden or shown.  You cannot hide a modal window.
  124.  
  125.   Show indicates if the window is being hidden or displayed.  The two constants that can be used for this flag are wShow and wHide.
  126.  
  127.   When working with windows that are opened and closed frequently, you can take advantage of WindowDisplay instead of closing the window and opening it and having to recreate its contents.  This is particularly useful when used on a tool bar or a floating palette because a hidden window remembers the settings of all the objects on the window (picture buttons, check boxes and radio buttons, editing fields, etc.) as well as the window’s location.  When the window is displayed again, it is identical in position and appearance as when it was hidden.
  128.  
  129.   Before you hide a window, realize that the user thinks the window is being closed (even though it may only be temporary).  Don’t leave the window in an “unsettled” state when your are hiding it.  Make sure that all editing fields are validated and processed.
  130.  
  131.   When a window is hidden, it does not release any memory consumed by its associated user interface elements such as buttons (including radio buttons and check boxes), picture buttons, pop-up menus, scroll bars, editing fields, list boxes, and custom controls.  If a window is being hidden and it contains an active editing field, that field is automatically deactivated before the window is hidden.  The impact to your application is that you must save the field’s edited text (with the SaveFieldString routine) before hiding the window.  If you want to validate the field’s edited text before saving it, see the GetFieldString routine.
  132.  
  133.   CONST                   {Window displaying options:  }
  134.     wShow = true;         {Display (unhide)            }
  135.     wHide = false;        {Hide window                 }
  136.  
  137. ------------------------------------------------------------------------
  138.  
  139. ActivateWindow
  140. ``````````````
  141. Activate a window.
  142.  
  143.    pascal void ActivateWindow (short Window);
  144.  
  145.    procedure ActivateWindow(Window: INTEGER);
  146.  
  147.   Window specifies the window number that is activated.  The specified window is brought forward and becomes “active” and “current.”  This window is also considered to be the “work” window.  If the window is hidden or not open, ActivateWindow does nothing.
  148.  
  149.   If the tool bar is activated, it simply becomes the current window (because the tool bar is always active).  If a floating palette is activated, it is brought to the front of the floating palette layer without deactivating any windows.  When a standard window is activated, it is brought to the front of the standard window layer, and the previously active standard window is deactivated
  150.  
  151.   A window will normally be activated only in response to a doChgWindow event that is reported during polling.  Another possible use of ActivateWindow is if your application has a “Window” menu that lets the user activate a window from a menu.  Don’t mysteriously activate an inactive window.
  152.  
  153. ------------------------------------------------------------------------
  154.  
  155. CurrentWindow
  156. `````````````
  157. Make a window the current window without activating it.
  158.  
  159.    pascal void CurrentWindow (short Window);
  160.  
  161.    procedure CurrentWindow(Window: INTEGER);
  162.  
  163.   Subsequent window related operations such as drawing, and creating fields, buttons, scroll bars, etc., will occur in the specified window without making it the “active” window.  This routine is used to redirect your application’s actions to a window other than the active one.
  164.  
  165.   Window specifies the window number in which subsequent window related operations will occur.  If the specified window is not open, CurrentWindow does nothing.
  166.  
  167.   The CurrentWindowReset procedure resets window operations back to the “active” window making the active window current too.  You should get into the habit of leaving the active window current.  It makes debugging much simpler.
  168.  
  169. ------------------------------------------------------------------------
  170.  
  171. CurrentWindowReset
  172. ``````````````````
  173. Reset the “current” window to be the same as the “active” window.
  174.  
  175.    pascal void CurrentWindowReset(void);
  176.  
  177.    procedure CurrentWindowReset;
  178.  
  179.   Subsequent window related operations such as drawing, and creating fields, buttons, scroll bars, etc., will occur in the “active” window.  This procedure nullifies the effect of the CurrentWindow procedure making the “active” window current also.  If your application uses a tool bar and/or floating palettes, then the work window will become current.
  180.  
  181. ------------------------------------------------------------------------
  182.  
  183. WindowTitle
  184. ```````````
  185. Change a window’s title.
  186.  
  187.    pascal void WindowTitle (short Window, Str255 Title);
  188.  
  189.    procedure WindowTitle(Window: INTEGER; Title: STRING);
  190.  
  191.   The WindowTitle procedure changes the title for an open window, regardless if it is active or not.  You can only see the change on windows that have a title bar (documentProc, noGrowDocProc, rDocProc, paletteProc and ordPaletteProc).  You won’t see any change on windows that do not display titles (dBoxProc, plainDBox, altDBoxProc, altPaletteProc, and the tool bar).
  192.  
  193.   Window specifies the window number in which the title is to be changed.  The specified window does not have to be the “active” window, however, the window must be opened to display the title.  Hidden windows will display the new title once they become visible.  If the window is not open, WindowTitle does nothing.
  194.  
  195. Title contains the window’s new title.
  196.  
  197. ------------------------------------------------------------------------
  198.  
  199. SetWindowSizeLimits
  200. ```````````````````
  201.   Set a window’s size limits that will determine the minimum and maximum size allowable when using the “size box” or “zoom box.”
  202.  
  203.    pascal void SetWindowSizeLimits (short minHoriz, short minVert,
  204.                  short maxHoriz, short MaxVert);
  205.  
  206.    procedure SetWindowSizeLimits(minHoriz, minVert, maxHoriz,
  207.                  maxVert: INTEGER);
  208.  
  209.   MinHoriz specifies the minimum width (in pixels) the window may attain when being sized.
  210.  
  211.   MinVert specifies the minimum height (in pixels) the window may attain when being sized.
  212.  
  213.   MaxHoriz specifies the maximum width (in pixels) the window may attain when being sized.
  214.  
  215.   MaxVert specifies the maximum height (in pixels) the window may attain when being sized.
  216.  
  217.   SetWindowSizeLimits affects only the current window.  If the current window is not a Tools Plus window, SetWindowSizeLimits does nothing.  The minimum and maximum limits imposed on a window are automatically adjusted (if necessary) to ensure that the window’s current size does not exceed the adjusted limits.  For example, if the minHoriz limit is set to 100 pixels and the window is currently 90 pixels wide (10 pixels smaller than the specified minimum width), minHoriz is adjusted to 90 pixels.  The same applies if the maximum limit is exceeded by the window’s current dimensions.
  218.  
  219.   By setting these limits, it is possible to allow a window to be sized horizontally or vertically only.
  220.  
  221. ------------------------------------------------------------------------
  222.  
  223. SetWindowZoom
  224. `````````````
  225.   Set a window’s standard co-ordinates and user co-ordinates that are in effect when the window’s “zoom box” is clicked.
  226.  
  227.    pascal void SetWindowZoom (Rect *userRect, Rect *stdRect);
  228.  
  229.    procedure SetWindowZoom(userRect, stdRect: RECT);
  230.  
  231.   A window containing a zoom box has two different states: [1] the standard state, and [2] the user state.  The user can change the window’s size and/or location, thereby defining the user state.  When the zoom box is clicked, the window “zooms” back to the standard state (which, by default, is the window’s co-ordinates when it was first opened).  Clicking the zoom box again reverts to the user state.
  232.  
  233.   Sometimes it is desirable to have the standard state and/or user state something other than the window’s initial co-ordinates.  SetWindowZoom sets either or both of these.  The window’s current co-ordinates become the user state.  It is good form to call SetWindowZoom immediately after opening a window.
  234.  
  235.   UserRect defines a rectangle in global co-ordinates that determines the window’s user co-ordinates.  If the current window is not a Tools Plus window, if the current window has no zoom box, or if an empty rectangle is specified, the user co-ordinates are not set.
  236.  
  237.   StdRect defines a rectangle in global co-ordinates that determines the window’s standard co-ordinates.  If the current window is not a Tools Plus window, if the current window has no zoom box, or if an empty rectangle is specified, the standard co-ordinates are not set.
  238.  
  239.   If the tool bar is open and it was created with the tbOffsetNewWindows option, this window’s co-ordinates for userRect and stdRect are shifted downwards by an amount that is equal to the tool bar’s height.
  240.  
  241. Warning: When you set the user and standard co-ordinates, make sure that
  242.          they are such that at least part of the window’s title bar is
  243.          visible to allow the window to be dragging back into view
  244.          (don’t zoom to an “off-screen” window).  Ideally, the zoom box
  245.          should always be visible.
  246.  
  247. ------------------------------------------------------------------------
  248.  
  249. GetWindowZoom
  250. `````````````
  251. Get a window’s standard state and user state for zooming.
  252.  
  253.    pascal void GetWindowZoom (Rect *userRect, Rect *stdRect);
  254.  
  255.    procedure GetWindowZoom(var userRect, stdRect: RECT);
  256.  
  257.   A window containing a zoom box has two different states: [1] the standard state, and [2] the user state.  The user can change the window’s size and/or location, thereby defining the user state.  When the zoom box is clicked, the window “zooms” back to the standard state (which, by default, is the window’s co-ordinates when it was first opened).  Clicking the zoom box again reverts to the user state.
  258.  
  259.   UserRect defines the window’s user state in the screen’s global co-ordinates.
  260.  
  261.   StdRect defines the window’s standard state in the screen’s global co-ordinates.
  262.  
  263.   If the tool bar is open and it was created with the tbOffsetNewWindows option, this window’s userRect and stdRect are shifted upwards by an amount that is equal to the tool bar’s height (i.e., they are shifted up as though there was no tool bar)..
  264.  
  265.   GetWindowZoom gets the values for the current window.  If the current window is not a Tools Plus window, or if the current window has no zoom box, the userRect and stdRect rectangles are undefined.  This procedure is useful if you want to save both states as part of the document.  When the document is opened, a window could be created using the userRect co-ordinates, and the user and standard state can be set by using the SetWindowZoom procedure.
  266.  
  267. ------------------------------------------------------------------------
  268.  
  269. WindowStatus
  270. ````````````
  271. Get a window’s status information.
  272.  
  273.    pascal void WindowStatus (short Window, TPWindowStatus *Status);
  274.  
  275.    procedure WindowStatus(Window: INTEGER; var Status: TPWindowStatus);
  276.  
  277.   The WindowStatus procedure returns the status of any Tools Plus window, whether it is open or closed, displayed or hidden.
  278.  
  279.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.  If it is not, the Status record is initialized to “false” and 0 values.  MaxWindows defines the maximum number of Tools Plus windows that may be open at any time.
  280.  
  281.   The Status record contains information about the Tools Plus window indicated by the Window value.  The record is defined as such:
  282.  
  283.    struct TPWindowStatus {
  284.      short Kind;             /*Tool Bar, Palette, or Standard kind   */
  285.      Boolean Open;           /*Is the window open?                   */
  286.      Boolean Visible;        /*Is this window visible (not hidden)?  */
  287.      Boolean Active;         /*Is this window active?                */
  288.      Boolean Front;          /*Is this front most Tools Plus window? */
  289.      Boolean Current;        /*Is this the current window?           */
  290.      Boolean WorkWindow;     /*Is this the work window?              */
  291.      Boolean EditFieldWindow;/*Does window have app's active field?  */
  292.      short ActiveField;      /*Window's active field number          */
  293.      Rect StrucRect;         /*Window’s structure rect (global)      */
  294.      Rect ContRect;          /*Window’s content rect (global)        */
  295.      };
  296.    typedef struct TPWindowStatus TPWindowStatus;
  297.  
  298.  
  299.    TPWindowStatus = record    {                                      }
  300.      Kind: integer;           {Tool Bar, Palette, or Standard kind   }
  301.      Open: boolean;           {Is the window open?                   }
  302.      Visible: boolean;        {Is this window visible (not hidden)?  }
  303.      Active: boolean;         {Is this window active?                }
  304.      Front: boolean;          {Is this front most Tools Plus window? }
  305.      Current: boolean;        {Is this the current window?           }
  306.      WorkWindow: boolean;     {Is this the work window?              }
  307.      EditFieldWindow: boolean;{Does window have app's active field?  }
  308.      ActiveField: integer;    {Window's active field number          }
  309.      StrucRect: rect;         {Window’s structure rect (global)      }
  310.      ContRect: rect;          {Window’s content rect (global)        }
  311.    end;
  312.  
  313.  
  314.   Kind indicates the kind of window being referenced.  The various kinds of windows are:
  315.     wNoKind       = 0   Window is not open
  316.     wToolBarKind  = 1   Tool Bar
  317.     wFloatingKind = 2   Floating palette
  318.     wStandardKind = 3   Standard window
  319.  
  320.   Open indicates if the referenced window is open.
  321.  
  322.   Visible indicates if the referenced window is visible or not.  The term “visible” refers to being programatically unhidden.  It does not mean “obscured by other windows or objects.”
  323.  
  324.   Active indicates if the referenced window is active.  A Tools Plus window will not be active under any of the following conditions:
  325.     • the window is not open
  326.     • the referenced window is a standard window, but not the front most
  327.       standard window
  328.     • the active window is a desk accessory (System 5/6’s Finder only)
  329.  
  330.   Front indicates if the referenced window is the front most window in your application.  If your application is not using a tool bar or floating palettes, the front most window is active unless:
  331.     • a desk accessory is active
  332.     • another application or the Finder is active (under MultiFinder or
  333.       System 7)
  334.  
  335.   Current indicates if the referenced window is the current window.  If your application does not use a tool bar or floating palettes, current and active are the same unless you used the CurrentWindow procedure to change the current window number.
  336.  
  337.   WorkWindow indicates if the referenced window is the work window.  This is the same as active if your application does not use a tool bar or floating palettes.
  338.  
  339.   EditFieldWindow indicates if the referenced window contains your application’s active editing field (see the Editing Fields chapter for details).
  340.  
  341.   ActiveField specifies the active editing field number for the referenced window.  For standard windows, this field becomes active when the window is active.  For the tool bar and floating palettes, this field is active while the application is active.
  342.  
  343.   StrucRect is the window’s structure rectangle in global co-ordinates.  This includes the window’s frame, shadow, and title bar.
  344.  
  345.   ContRect is the window’s content rectangle in global co-ordinates.  This is the window’s usable area excluding the window’s frame, shadow, and title bar.
  346.  
  347. CONST                     {Kinds of windows:             }
  348.     wNoKind       = 0;    {Not open                      }
  349.     wToolBarKind  = 1;    {Tool Bar                      }
  350.     wFloatingKind = 2;    {Floating Palette              }
  351.     wStandardKind = 3;    {Standard Window               }
  352.  
  353. ------------------------------------------------------------------------
  354.  
  355. ActiveWindowNumber
  356. ``````````````````
  357. Get the window number of the active window (or work window number if a tool bar and/or floating palettes are used).
  358.  
  359.    pascal short ActiveWindowNumber(void);
  360.  
  361.    function ActiveWindowNumber: INTEGER;
  362.  
  363.   This function returns the window number of the active window.  If your application does not have a tool bar or floating palettes, this is the front most window.  When a tool bar and/or floating palettes are used, ActiveWindowNumber returns the work window number.  A value of zero (0) is returned if any of the following conditions occurs:
  364.     • no windows are open
  365.     • the active window is a desk accessory
  366.     • another application or the Finder is active (under MultiFinder or
  367.       System 7)
  368.  
  369. Also see:  CurrentWindowNumber, FirstWindowNumber, FirstStdWindowNumber, FirstPaletteNumber and WorkWindowNumber.
  370.  
  371. ------------------------------------------------------------------------
  372.  
  373. CurrentWindowNumber
  374. ```````````````````
  375. Get the window number of the current window.
  376.  
  377.    pascal short CurrentWindowNumber(void);
  378.  
  379.    function CurrentWindowNumber: INTEGER;
  380.  
  381.   This function returns the window number of the current window.  If your application does not have a tool bar or floating palettes, this window is the same as the active window unless you used the CurrentWindow procedure to change the current window.  A value of zero (0) is returned if any of the following conditions occurs:
  382.     • no windows are open
  383.     • the current window is a desk accessory
  384.     • another application or the Finder is current (under MultiFinder or
  385.       System 7)
  386.  
  387. Also see: ActiveWindowNumber and FirstWindowNumber.
  388.  
  389. ------------------------------------------------------------------------
  390.  
  391. FirstWindowNumber
  392. `````````````````
  393. Get the window number of your application’s front most window.
  394.  
  395.    pascal short FirstWindowNumber(void);
  396.  
  397.    function FirstWindowNumber: INTEGER;
  398.  
  399.   This function is typically used to determined the front most window in order to close it or apply some equally universal operation to that window.  If your application does not have a tool bar or floating palettes, this is your application’s front most window.  If your application has a tool bar or floating palettes, FirstWindowNumber returns the number of the window that satisfies any of the following conditions (in ascending order of priority):
  400.     • the front most modal window (it is a standard window)
  401.     • the front most floating palette (if one is open and visible)
  402.     • the front most modeless standard window (if one is open and
  403.       visible)
  404. FirstWindowNumber always ignores the tool bar.
  405.  
  406.   A value of zero (0) is returned if no windows are open.  Note that the front most window in your application will not be the active window under any of the following conditions:
  407.     • a desk accessory is active
  408.     • another application or the Finder is active (under MultiFinder or
  409.       System 7)
  410.  
  411. Also see:  CurrentWindowNumber, FirstWindowNumber, FirstStdWindowNumber, FirstPaletteNumber and WorkWindowNumber.
  412.  
  413. ------------------------------------------------------------------------
  414.  
  415. ToolBarNumber
  416. `````````````
  417. Get the window number of your application’s tool bar.
  418.  
  419.    pascal short ToolBarNumber(void);
  420.  
  421.    function ToolBarNumber: INTEGER;
  422.  
  423.   This function returns the window number of your application’s tool bar.  If your application does not have a tool bar, or if the tool bar has been hidden, ToolBarNumber returns a value of zero (0).  You can use this routine in place of a global variable to determine if an event pertains to the tool bar.
  424.  
  425. ------------------------------------------------------------------------
  426.  
  427. FirstPaletteNumber
  428. ``````````````````
  429. Get the window number of your application’s front most floating palette.
  430.  
  431.    pascal short FirstPaletteNumber(void);
  432.  
  433.    function FirstPaletteNumber: INTEGER;
  434.  
  435.   This function returns the window number of your application’s front most visible floating palette.  If your application does not have floating palettes, or if they are all hidden, FirstPaletteNumber returns a value of zero (0).
  436.  
  437. ------------------------------------------------------------------------
  438.  
  439. FirstStdWindowNumber
  440. ````````````````````
  441. Get the window number of your application’s front most standard window.
  442.  
  443.    pascal short FirstStdWindowNumber(void);
  444.  
  445.    function FirstStdWindowNumber: INTEGER;
  446.  
  447.   This function returns the window number of your application’s front most visible standard window.  If your application does not have standard windows, or if they are all hidden, FirstStdWindowNumber returns a value of zero (0).  Note that this window may be modal.
  448.  
  449. ------------------------------------------------------------------------
  450.